/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *   gbx-emu - settingsdialog.h                                            *
 *   gbx-emu homepage: http://code.google.com/p/gbx-emu/                   *
 *   Copyright (C) 2009 olejl77@gmail.com                                  *
 *                                                                         *
 *   This program is free software: you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation, either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QtGui/QDialog>
#include <QSettings>
#include <QSignalMapper>

namespace Ui {
    class SettingsDialog;
}

enum {
    KeyUp,
    KeyDown,
    KeyLeft,
    KeyRight,
    KeySelect,
    KeyStart,
    KeyA,
    KeyB
};

class Log;
class SettingsDialog : public QDialog {
    Q_OBJECT
    Q_DISABLE_COPY(SettingsDialog)
public:
    explicit SettingsDialog(QWidget *parent = 0, QSettings *ptr = NULL, Log *ptr2 = NULL);
    virtual ~SettingsDialog();

protected:
    virtual void changeEvent(QEvent *e);

private slots:
    void clicked(int value);
    void clickedLevel(int value);
    void readSettings();
    void enableDebugger(bool enabled);
    void enableFrameLimiter(bool enabled);
    void clickedKey(int value);
private:
    Ui::SettingsDialog *m_ui;
    QSettings *m_settings;
    Log *m_log;
    QSignalMapper *smLog;
    QSignalMapper *smLevel;
    QSignalMapper *smKey;
};

#endif // SETTINGSDIALOG_H
